<?
//引入所有子系统信息
include_once("../../../common/script/extender_import.php");



//拿到申请退款的信息，记录各种信息。


$_price=$_REQUEST['ai_price'];
if (isset($_price) && is_numeric($_price)) {
    $_price = number_format((float)$_price, 2);
} else {
    // 可以设置默认值或者提示错误
    $_price = '0.00'; // 或 null / 空字符串，根据业务决定
}

$_REQUEST['ai_price']=$_price;

$_REQUEST['ai_apply_employee']      = $_SESSION['username'];
$_REQUEST['ai_authur']      = $_SESSION['username'];
$_REQUEST['ai_ip']          = $_SERVER["REMOTE_ADDR"];
$_REQUEST['ai_apply_status']          = "审核中";
//订单编号，订单TRANSACTION_ID，订单状态,套餐名称，客户nid，申请人，客户申请日期，停止配送时间，备注。



$_sql=insert_data($table_prefix."order_refund_apply_data",$_REQUEST);
$result=do_query($_sql);

//获取刚刚插入的数据的nid
$_new_refund_apply=select_one_line_all_items($table_prefix."order_refund_apply_data","1 =1 order by nid desc");

//print_r2($_new_refund_apply);

//触发微信通知

    echo $url="https://".$host."/api/wechat_message/refund_apply_creat.php?nid=".$_new_refund_apply['nid'];
$result=file_get_contents($url);
    //$result=_sock($url);
    //var_dump($result);

?>


<script type="text/javascript">

    alert("输入信息已保存，点击确认返回继续操作.");
   document.location.href = "data_refund_window.php?nid=<?echo $_REQUEST['ai_order_nid']?>"

</script>
